package com.andnnl.act.conf;

import act.app.conf.AutoConfig;
import act.controller.annotation.UrlContext;
import org.osgl.$;
import org.osgl.http.H;
import org.osgl.inject.annotation.Configuration;
import org.osgl.mvc.annotation.GetAction;
import org.osgl.mvc.annotation.ResponseContentType;
import org.osgl.util.Const;

import java.util.Map;

/**
 * 所有的下划线被替换为 .: FOO_BAR -> FOO.BAR
 * 所有的大写转换为小写: FOO.BAR -> foo.bar
 * 用 . 和前缀相连: foo.bar -> myconf.foo.bar
 *
 * 参考：https://gitee.com/actframework/act-doc/blob/master/cn/configuration.md
 * Created by chenss on 2019/12/3.
 */
@UrlContext("/conf")
@AutoConfig("myconf") // 注意: 这里 `myconf` 指定配置的前缀, 如果没有则默认为 `app`
public class ConfTest4 {

    private static final Const<Integer> FOO_BAR = $.constant();
    private static final Const<Integer> FOO_BAR2 = $.constant();

    @GetAction("auto_conf")
    public int autoConf() {
        return FOO_BAR.get();
    }

    @GetAction("auto_conf2")
    public int autoConf2() {
        return FOO_BAR2.get();
    }



}